﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Diagnostics;
using System.ComponentModel;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Xml.Serialization;

namespace PDO.DataPersistence.Core
{
    [Table(Name = "[PersistableDataObjectRoot : no table association]")]
    public class PersistableDataObjectRoot : PersistableDataObject
    {
        private string _dbKey;

        public override string DBKey
        {
            get
            {
                if (null == _dbKey)
                {
                    _dbKey = Guid.NewGuid().ToString();
                }
                return _dbKey;
            }
        }

        protected override bool Insert()
        {
            return true; // no-up
        }
        protected override bool Update()
        {
            return true; // no-up
        }

        protected override bool Purge()
        {
            return true; // no-up
        }

        protected override bool Read(object id)
        {
            return true; // no-up
        }

        public override void LoadFromDataRow(DataRow dr)
        {
            return; // no-up
        }
    }
}
